﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.PageFlow;

namespace TestWCSFSitemaps.Payments.Services
{
    public class NavigatonService : INavigation
    {
        private IPageFlow paymentPageFlow;
        private IPageFlowProvider pageFlowProvider;

        public void GoX()
        {
            PaymentPageFlow.Navigate("goPayX");
        }

        public void GoY()
        {
            PaymentPageFlow.Navigate("goPayY");
        }

        public void GoZ()
        {
            PaymentPageFlow.Navigate("goPayZ");
        }

        public Microsoft.Practices.PageFlow.IPageFlow PaymentPageFlow
        {
            get 
            {
                if (paymentPageFlow == null && pageFlowProvider != null)
                    paymentPageFlow = pageFlowProvider.GetPageFlow(typeof(PageFlows.PaymentPageFlow));

                return paymentPageFlow;
            }
        }

        public Microsoft.Practices.PageFlow.IPageFlowProvider PageFlowProvider
        {
            set 
            { 
                pageFlowProvider = value; 
            }
        }
    }
}
